package com.itawei.d3_io;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

/*
 字节输入流：FileInputStream
 */
public class ByteStreamDemo4 {
    public static void main(String[] args) throws IOException {
        //需求:读取文件中的数据
        //步骤：1.创建对象
        FileInputStream fis = new FileInputStream("day06-file-io\\a.txt");
        //2.读取数据
        int i1 = fis.read();
        System.out.println((char) i1);
        int i2 = fis.read();
        System.out.println((char)i2);
        int i3 = fis.read();
        System.out.println((char)i3);
        int i4 = fis.read();
        System.out.println((char)i4);
        int i5 = fis.read();
        System.out.println((char)i5);
        int i6 = fis.read();
        System.out.println(i6);
        //3.释放数据
        fis.close();
    }
}
